
/***********************************************************

    *FileName:      mapUtils.js
    *Description:   地图操作工具类，该文件对地图常用功能进行封装
    *Version:       1.0.0
    *Aurthor:       liuqiang
    *CreateDate:    2022/02/19

    --------------------------------------------------------
    *updateDate:
    *Aurthor:liuqiang
    *Description:

***********************************************************/

// 弹跳动画
const mapUtils = {}
mapUtils.bounce = function (t) {
  const s = 7.5625
  const p = 2.75
  let l
  if (t < (1 / p)) {
    l = s * t * t
  } else {
    if (t < (2 / p)) {
      t -= (1.5 / p)
      l = s * t * t + 0.75
    } else {
      if (t < (2.5 / p)) {
        t -= (2.25 / p)
        l = s * t * t + 0.9375
      } else {
        t -= (2.625 / p)
        l = s * t * t + 0.984375
      }
    }
  }
  return l
}

export default mapUtils
